var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (a, t) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, a) {
              e.__proto__ = a;
            }) ||
          function (e, a) {
            for (var t in a)
              Object.prototype.hasOwnProperty.call(a, t) && (e[t] = a[t]);
          })(a, t);
      };
      return function (a, t) {
        function n() {
          this.constructor = a;
        }
        if ("function" != typeof t && null !== t)
          throw new TypeError(
            "Class extends value " + String(t) + " is not a constructor or null"
          );
        e(a, t),
          (a.prototype =
            null === t
              ? Object.create(t)
              : ((n.prototype = t.prototype), new n()));
      };
    })(),
  AXSubordCommonView = (function (e) {
    function a() {
      var a = e.call(this) || this;
      return (
        (a.onLoadZhanDouNengLiDataFn = {
          caller: a,
          code: 1109,
          method: function (e) {
            0 != e.code
              ? ToastView.toastView(e.msg)
              : ((a.lable_CZPY_Title.text = a.subObj.name + ""),
                (a.lable_sub_mingzhonglv.text = a.dealSubBaltteRate(
                  e.data.mzl
                )),
                (a.lable_sub_fanjilv.text = a.dealSubBaltteRate(e.data.fjl)),
                (a.lable_sub_fashubao.text = a.dealSubBaltteRate(e.data.fsbjl)),
                (a.lable_sub_duobilv.text = a.dealSubBaltteRate(e.data.dsl)),
                (a.lable_sub_kangxuanji.text = a.dealSubBaltteRate(
                  e.data.kxhp
                )),
                (a.lable_sub_kangraoluan.text = a.dealSubBaltteRate(
                  e.data.krl
                )),
                (a.lable_sub_kangfengsha.text = a.dealSubBaltteRate(
                  e.data.kfs
                )),
                (a.lable_sub_kangdushu.text = a.dealSubBaltteRate(e.data.kd)),
                (a.lable_sub_baojilv.text = a.dealSubBaltteRate(e.data.wlbjl)),
                (a.lable_sub_zhiminglv.text = a.dealSubBaltteRate(e.data.zml)),
                (a.lable_sub_fanzhenlv.text = a.dealSubBaltteRate(e.data.fjl)),
                (a.lable_sub_kangwuli.text = a.dealSubBaltteRate(e.data.kwldj)),
                (a.lable_sub_kangfengsou.text = a.dealSubBaltteRate(
                  e.data.kfjn
                )),
                (a.lable_sub_kangweikun.text = a.dealSubBaltteRate(e.data.kwk)),
                (a.lable_sub_kangyaohuo.text = a.dealSubBaltteRate(e.data.kyh)),
                (a.lable_sub_kangluolei.text = a.dealSubBaltteRate(
                  e.data.kll
                )));
          },
        }),
        (a.onLoadChuZhiPeiYangDataFn = {
          caller: a,
          code: 1110,
          method: function (e) {
            0 != e.code
              ? ToastView.toastView(e.msg)
              : ((a.lable_CZPY_Title.text = a.subObj.name + " 培养"),
                (a.lable_peiyang_jiangjunling.text = e.data.jjlc + "枚"),
                e.data.czl == e.data.czlMax
                  ? (a.btn_peiyang_chengzhanglv.visible = !1)
                  : (a.btn_peiyang_chengzhanglv.visible = !0),
                (a.lable_peiyang_upRate.text =
                  e.data.czl +
                  "(" +
                  e.data.czlMin +
                  " ~ " +
                  e.data.czlMax +
                  ")"),
                e.data.hp == e.data.hpMax
                  ? (a.btn_peiyang_qixue.visible = !1)
                  : (a.btn_peiyang_qixue.visible = !0),
                (a.lable_peiyang_qixue.text =
                  e.data.hp + "(" + e.data.hpMin + " ~ " + e.data.hpMax + ")"),
                e.data.mp == e.data.mpMax
                  ? (a.btn_peiyang_jingli.visible = !1)
                  : (a.btn_peiyang_jingli.visible = !0),
                (a.lable_peiyang_jingli.text =
                  e.data.mp + "(" + e.data.mpMin + " ~ " + e.data.mpMax + ")"),
                e.data.ap == e.data.apMax
                  ? (a.btn_peiyang_gongji.visible = !1)
                  : (a.btn_peiyang_gongji.visible = !0),
                (a.lable_peiyang_gongji.text =
                  e.data.ap + "(" + e.data.apMin + " ~ " + e.data.apMax + ")"),
                e.data.sp == e.data.spMax
                  ? (a.btn_peiyang_minjie.visible = !1)
                  : (a.btn_peiyang_minjie.visible = !0),
                (a.lable_peiyang_minjie.text =
                  e.data.sp + "(" + e.data.spMin + " ~ " + e.data.spMax + ")"));
          },
        }),
        (a.onLoadQuDingPeiyangData = {
          caller: a,
          code: 1122,
          method: function (e) {
            0 == e.code
              ? (WebSocketService.send({ c: 1110, d: { cid: a.subObj.id } }),
                (a.label_peiyang_success.visible = !0),
                (a.label_peiyang_success.text = "培养成功"),
                Laya.timer.once(2e3, a, function () {
                  (this.label_peiyang_success.text = ""),
                    (this.label_peiyang_success.visible = !1);
                }))
              : ToastView.toastView(e.msg);
          },
        }),
        WebSocketService.addListener(a.onLoadZhanDouNengLiDataFn),
        WebSocketService.addListener(a.onLoadChuZhiPeiYangDataFn),
        WebSocketService.addListener(a.onLoadQuDingPeiyangData),
        a.btn_zhandouCancle.on(Laya.Event.CLICK, a, a.close),
        a.btn_peiyang_chengzhanglv.on(Laya.Event.CLICK, a, a.onPeiyangDidClick),
        a.btn_peiyang_qixue.on(Laya.Event.CLICK, a, a.onPeiyangDidClick),
        a.btn_peiyang_jingli.on(Laya.Event.CLICK, a, a.onPeiyangDidClick),
        a.btn_peiyang_gongji.on(Laya.Event.CLICK, a, a.onPeiyangDidClick),
        a.btn_peiyang_minjie.on(Laya.Event.CLICK, a, a.onPeiyangDidClick),
        a
      );
    }
    return (
      __extends(a, e),
      (a.showCommonView = function (e, t) {
        null == this.commonView &&
          ((this.commonView = new a()), (this.commonView.zOrder = 1e3)),
          this.commonView.popup(!0),
          (this.commonView.subObj = e),
          (this.commonView.label_peiyang_success.visible = !1),
          "chuzhipeiyang" == t
            ? ((this.commonView.image_zhandou.visible = !1),
              (this.commonView.image_peiyang.visible = !0),
              WebSocketService.send({ c: 1110, d: { cid: e.id } }))
            : "zhandoushuoming" == t &&
              ((this.commonView.image_zhandou.visible = !0),
              (this.commonView.image_peiyang.visible = !1),
              WebSocketService.send({ c: 1109, d: { id: e.id } }));
      }),
      (a.prototype.onPeiyangDidClick = function (e) {
        var a;
        "item0" == e.target.name
          ? (a = 1)
          : "item1" == e.target.name
          ? (a = 2)
          : "item2" == e.target.name
          ? (a = 3)
          : "item3" == e.target.name
          ? (a = 4)
          : "item4" == e.target.name && (a = 5),
          WebSocketService.send({ c: 1122, d: { cid: this.subObj.id, py: a } });
      }),
      (a.prototype.dealSubBaltteRate = function (e) {
        var a = parseInt(e);
        return 0 == a ? "0%" : a + "%";
      }),
      (a.close = function () {
        this.commonView && this.commonView.close();
      }),
      a
    );
  })(ui.SuboardinateController.AXSubordCommonViewUI);
